package archer.framework.security.analog;

import archer.framework.security.ArcherSecurityModule;
import archer.framework.security.token.Subject;

import java.io.Serializable;

/**
 * 虚拟用户
 *
 * @author kent
 * @date 16/7/7.
 */
public class AnalogUser implements Subject, Serializable {

    /**
     * 系统虚拟用户
     */
    public static AnalogUser ANALOG_USER_SYSTEM = new AnalogUser(ArcherSecurityModule.defaultAnalogUserId);

    // 虚拟用户id
    private String id;

    /**
     * constructor
     *
     * @param id
     */
    public AnalogUser(String id) {
        this.id = id;
    }

    @Override
    public Object getUserId() {
        return getId();
    }


    //-------------------------------- getter setter -----------------------------------
    public String getId() {
        return id;
    }

    public AnalogUser setId(String id) {
        this.id = id;
        return this;
    }
}
